/*
 * Composition Knowledge Miner. A data mashup composition knowledge miner
 * Copyright (C) 2011 Carlos Rodriguez
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package eu.ict_omelette.mashup.compositionminer;

import eu.ict_omelette.mashup.canonicalmodel.CanonicalMashup;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 *
 * @author carlos
 */
public class CompositionMiner {
    
    private LinkedList<CanonicalMashup> compRepo;
    
    public CompositionMiner(){
        compRepo = new LinkedList();
    }

    public void addCompositionToRepo(CanonicalMashup cm){
        compRepo.add(cm);
    }

    public List<CanonicalMashup> mineConnectorCoOccurrencePattern(double minSupDf, double minSupDm){
        ConnectorCoOccurrencePattern ccp = new ConnectorCoOccurrencePattern(this.compRepo);
        return ccp.mine(minSupDf, minSupDm);
        
    }

    public List<CanonicalMashup> mineParameterValuePattern(Double minSupp){
        ParameterValueMiner pvm = new ParameterValueMiner(this.compRepo);

        return pvm.mine(minSupp);
        
    }
      
    public Iterator<CanonicalMashup> getRepo(){
        return this.compRepo.iterator();
    }

    public int getRepoSize(){
        return compRepo.size();
    }

    public List<CanonicalMashup> mineComponentCoOccurrencePattern(Double minSupDf, Double minSupDm, Double minSupVa){
        ComponentCoOccurrenceMiner ccom = new ComponentCoOccurrenceMiner(this.compRepo);

        return ccom.mine(minSupDf, minSupDm, minSupVa);
    }

    public List<CanonicalMashup> mineConnectorPattern(double minSupDf, double minSupDm){
        ConnectorPatternMiner cpm = new ConnectorPatternMiner(this.compRepo);

        return cpm.mine(minSupDf, minSupDm);
    }


}
